home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / ColorSync 3.0 Mac SDK / Interfaces / CMICCProfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-28  |  31.5 KB  |  933 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMICCProfile.h
  3.  
  4.      Contains:    ICC Profile Format Definitions
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    ColorSync 3.0 SDK for use with Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1994-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMICCPROFILE__
  18. #define __CMICCPROFILE__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23.  
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47. /* ICC Profile version constants  */
  48. enum {
  49.     cmICCProfileVersion2        = 0x02000000,
  50.     cmICCProfileVersion21        = 0x02100000,
  51.     cmCS2ProfileVersion            = cmICCProfileVersion2,
  52.     cmCS1ProfileVersion            = 0x00000100                    /* ColorSync 1.0 profile version */
  53. };
  54.  
  55. /* Current Major version number */
  56. enum {
  57.     cmProfileMajorVersionMask    = (long)0xFF000000,
  58.     cmCurrentProfileMajorVersion = 0x02000000
  59. };
  60.  
  61. /* magic cookie number for anonymous file ID */
  62. enum {
  63.     cmMagicNumber                = FOUR_CHAR_CODE('acsp')
  64. };
  65.  
  66.  
  67. /************************************************************************/
  68. /*************** ColorSync 2.0 profile specification ********************/
  69. /************************************************************************/
  70. /**** flags field  ****/
  71. enum {
  72.     cmICCReservedFlagsMask        = 0x0000FFFF,                    /* these bits of the flags field are defined and reserved by ICC */
  73.     cmEmbeddedMask                = 0x00000001,                    /* if bit 0 is 0 then not embedded profile, if 1 then embedded profile */
  74.     cmEmbeddedUseMask            = 0x00000002,                    /* if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only */
  75.     cmCMSReservedFlagsMask        = (long)0xFFFF0000,                /* these bits of the flags field are defined and reserved by CMS vendor */
  76.     cmQualityMask                = 0x00030000,                    /* if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best */
  77.     cmInterpolationMask            = 0x00040000,                    /* if bit 18 is 0 then interpolation, if 1 then lookup only */
  78.     cmGamutCheckingMask            = 0x00080000                    /* if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info */
  79. };
  80.  
  81. /* copyright-protection flag options */
  82. enum {
  83.     cmEmbeddedProfile            = 0,                            /* 0 is not embedded profile, 1 is embedded profile */
  84.     cmEmbeddedUse                = 1                                /* 0 is to use anywhere, 1 is to use as embedded profile only */
  85. };
  86.  
  87. /* speed and quality flag options */
  88. enum {
  89.     cmNormalMode                = 0,                            /* it uses the least significent two bits in the high word of flag */
  90.     cmDraftMode                    = 1,                            /* it should be evaulated like this: right shift 16 bits first, mask off the */
  91.     cmBestMode                    = 2                                /* high 14 bits, and then compare with the enum to determine the option value */
  92. };
  93.  
  94.  
  95. /**** deviceAttributes fields ****/
  96. /* deviceAttributes[0] is defined by and reserved for device vendors */
  97. /* deviceAttributes[1] is defined by and reserved for ICC */
  98. /* The following bits of deviceAttributes[1] are currently defined */
  99. enum {
  100.     cmReflectiveTransparentMask    = 0x00000001,                    /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  101.     cmGlossyMatteMask            = 0x00000002                    /* if bit 1 is 0 then glossy, if 1 then matte */
  102. };
  103.  
  104. /* device/media attributes element values  */
  105. enum {
  106.     cmReflective                = 0,                            /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  107.     cmGlossy                    = 1                                /* if bit 1 is 0 then glossy, if 1 then matte */
  108. };
  109.  
  110.  
  111. /**** renderingIntent field ****/
  112. enum {
  113.     cmPerceptual                = 0,                            /* Photographic images */
  114.     cmRelativeColorimetric        = 1,                            /* Logo Colors */
  115.     cmSaturation                = 2,                            /* Business graphics */
  116.     cmAbsoluteColorimetric        = 3                                /* Logo Colors */
  117. };
  118.  
  119.  
  120.  
  121. /* data type element values */
  122. enum {
  123.     cmAsciiData                    = 0,
  124.     cmBinaryData                = 1
  125. };
  126.  
  127. /* screen encodings  */
  128. enum {
  129.     cmPrtrDefaultScreens        = 0,                            /* Use printer default screens.  0 is false, 1 is ture */
  130.     cmLinesPer                    = 1                                /* 0 is LinesPerCm, 1 is LinesPerInch */
  131. };
  132.  
  133. /* 2.0 tag type information */
  134. enum {
  135.     cmNumHeaderElements            = 10
  136. };
  137.  
  138. /* public tags */
  139. enum {
  140.     cmAToB0Tag                    = FOUR_CHAR_CODE('A2B0'),
  141.     cmAToB1Tag                    = FOUR_CHAR_CODE('A2B1'),
  142.     cmAToB2Tag                    = FOUR_CHAR_CODE('A2B2'),
  143.     cmBlueColorantTag            = FOUR_CHAR_CODE('bXYZ'),
  144.     cmBlueTRCTag                = FOUR_CHAR_CODE('bTRC'),
  145.     cmBToA0Tag                    = FOUR_CHAR_CODE('B2A0'),
  146.     cmBToA1Tag                    = FOUR_CHAR_CODE('B2A1'),
  147.     cmBToA2Tag                    = FOUR_CHAR_CODE('B2A2'),
  148.     cmCalibrationDateTimeTag    = FOUR_CHAR_CODE('calt'),
  149.     cmCharTargetTag                = FOUR_CHAR_CODE('targ'),
  150.     cmCopyrightTag                = FOUR_CHAR_CODE('cprt'),
  151.     cmDeviceMfgDescTag            = FOUR_CHAR_CODE('dmnd'),
  152.     cmDeviceModelDescTag        = FOUR_CHAR_CODE('dmdd'),
  153.     cmGamutTag                    = FOUR_CHAR_CODE('gamt'),
  154.     cmGrayTRCTag                = FOUR_CHAR_CODE('kTRC'),
  155.     cmGreenColorantTag            = FOUR_CHAR_CODE('gXYZ'),
  156.     cmGreenTRCTag                = FOUR_CHAR_CODE('gTRC'),
  157.     cmLuminanceTag                = FOUR_CHAR_CODE('lumi'),
  158.     cmMeasurementTag            = FOUR_CHAR_CODE('meas'),
  159.     cmMediaBlackPointTag        = FOUR_CHAR_CODE('bkpt'),
  160.     cmMediaWhitePointTag        = FOUR_CHAR_CODE('wtpt'),
  161.     cmNamedColorTag                = FOUR_CHAR_CODE('ncol'),
  162.     cmNamedColor2Tag            = FOUR_CHAR_CODE('ncl2'),
  163.     cmPreview0Tag                = FOUR_CHAR_CODE('pre0'),
  164.     cmPreview1Tag                = FOUR_CHAR_CODE('pre1'),
  165.     cmPreview2Tag                = FOUR_CHAR_CODE('pre2'),
  166.     cmProfileDescriptionTag        = FOUR_CHAR_CODE('desc'),
  167.     cmProfileSequenceDescTag    = FOUR_CHAR_CODE('pseq'),
  168.     cmPS2CRD0Tag                = FOUR_CHAR_CODE('psd0'),
  169.     cmPS2CRD1Tag                = FOUR_CHAR_CODE('psd1'),
  170.     cmPS2CRD2Tag                = FOUR_CHAR_CODE('psd2'),
  171.     cmPS2CRD3Tag                = FOUR_CHAR_CODE('psd3'),
  172.     cmPS2CSATag                    = FOUR_CHAR_CODE('ps2s'),
  173.     cmPS2RenderingIntentTag        = FOUR_CHAR_CODE('ps2i'),
  174.     cmRedColorantTag            = FOUR_CHAR_CODE('rXYZ'),
  175.     cmRedTRCTag                    = FOUR_CHAR_CODE('rTRC'),
  176.     cmScreeningDescTag            = FOUR_CHAR_CODE('scrd'),
  177.     cmScreeningTag                = FOUR_CHAR_CODE('scrn'),
  178.     cmTechnologyTag                = FOUR_CHAR_CODE('tech'),
  179.     cmUcrBgTag                    = FOUR_CHAR_CODE('bfd '),
  180.     cmViewingConditionsDescTag    = FOUR_CHAR_CODE('vued'),
  181.     cmViewingConditionsTag        = FOUR_CHAR_CODE('view')
  182. };
  183.  
  184. /* custom tags */
  185. enum {
  186.     cmPS2CRDVMSizeTag            = FOUR_CHAR_CODE('psvm'),
  187.     cmVideoCardGammaTag            = FOUR_CHAR_CODE('vcgt'),
  188.     cmMakeAndModelTag            = FOUR_CHAR_CODE('mmod')
  189. };
  190.  
  191. /* technology tag descriptions */
  192. enum {
  193.     cmTechnologyFilmScanner        = FOUR_CHAR_CODE('fscn'),
  194.     cmTechnologyReflectiveScanner = FOUR_CHAR_CODE('rscn'),
  195.     cmTechnologyInkJetPrinter    = FOUR_CHAR_CODE('ijet'),
  196.     cmTechnologyThermalWaxPrinter = FOUR_CHAR_CODE('twax'),
  197.     cmTechnologyElectrophotographicPrinter = FOUR_CHAR_CODE('epho'),
  198.     cmTechnologyElectrostaticPrinter = FOUR_CHAR_CODE('esta'),
  199.     cmTechnologyDyeSublimationPrinter = FOUR_CHAR_CODE('dsub'),
  200.     cmTechnologyPhotographicPaperPrinter = FOUR_CHAR_CODE('rpho'),
  201.     cmTechnologyFilmWriter        = FOUR_CHAR_CODE('fprn'),
  202.     cmTechnologyVideoMonitor    = FOUR_CHAR_CODE('vidm'),
  203.     cmTechnologyVideoCamera        = FOUR_CHAR_CODE('vidc'),
  204.     cmTechnologyProjectionTelevision = FOUR_CHAR_CODE('pjtv'),
  205.     cmTechnologyCRTDisplay        = FOUR_CHAR_CODE('CRT '),
  206.     cmTechnologyPMDisplay        = FOUR_CHAR_CODE('PMD '),
  207.     cmTechnologyAMDisplay        = FOUR_CHAR_CODE('AMD '),
  208.     cmTechnologyPhotoCD            = FOUR_CHAR_CODE('KPCD'),
  209.     cmTechnologyPhotoImageSetter = FOUR_CHAR_CODE('imgs'),
  210.     cmTechnologyGravure            = FOUR_CHAR_CODE('grav'),
  211.     cmTechnologyOffsetLithography = FOUR_CHAR_CODE('offs'),
  212.     cmTechnologySilkscreen        = FOUR_CHAR_CODE('silk'),
  213.     cmTechnologyFlexography        = FOUR_CHAR_CODE('flex')
  214. };
  215.  
  216. /* public type signatures */
  217. enum {
  218.     cmSigCurveType                = FOUR_CHAR_CODE('curv'),
  219.     cmSigDataType                = FOUR_CHAR_CODE('data'),
  220.     cmSigDateTimeType            = FOUR_CHAR_CODE('dtim'),
  221.     cmSigLut16Type                = FOUR_CHAR_CODE('mft2'),
  222.     cmSigLut8Type                = FOUR_CHAR_CODE('mft1'),
  223.     cmSigMeasurementType        = FOUR_CHAR_CODE('meas'),
  224.     cmSigNamedColorType            = FOUR_CHAR_CODE('ncol'),
  225.     cmSigNamedColor2Type        = FOUR_CHAR_CODE('ncl2'),
  226.     cmSigProfileDescriptionType    = FOUR_CHAR_CODE('desc'),
  227.     cmSigScreeningType            = FOUR_CHAR_CODE('scrn'),
  228.     cmSigS15Fixed16Type            = FOUR_CHAR_CODE('sf32'),
  229.     cmSigSignatureType            = FOUR_CHAR_CODE('sig '),
  230.     cmSigTextType                = FOUR_CHAR_CODE('text'),
  231.     cmSigU16Fixed16Type            = FOUR_CHAR_CODE('uf32'),
  232.     cmSigU1Fixed15Type            = FOUR_CHAR_CODE('uf16'),
  233.     cmSigUInt32Type                = FOUR_CHAR_CODE('ui32'),
  234.     cmSigUInt64Type                = FOUR_CHAR_CODE('ui64'),
  235.     cmSigUInt8Type                = FOUR_CHAR_CODE('ui08'),
  236.     cmSigUnicodeTextType        = FOUR_CHAR_CODE('utxt'),
  237.     cmSigViewingConditionsType    = FOUR_CHAR_CODE('view'),
  238.     cmSigXYZType                = FOUR_CHAR_CODE('XYZ ')
  239. };
  240.  
  241. /* custom type signatures */
  242. enum {
  243.     cmSigVideoCardGammaType        = FOUR_CHAR_CODE('vcgt'),
  244.     cmSigMakeAndModelType        = FOUR_CHAR_CODE('mmod')
  245. };
  246.  
  247.  
  248. /* Measurement type encodings */
  249. /* Measurement Flare */
  250. enum {
  251.     cmFlare0                    = 0x00000000,
  252.     cmFlare100                    = 0x00000001
  253. };
  254.  
  255. /* Measurement Geometry    */
  256. enum {
  257.     cmGeometryUnknown            = 0x00000000,
  258.     cmGeometry045or450            = 0x00000001,
  259.     cmGeometry0dord0            = 0x00000002
  260. };
  261.  
  262. /* Standard Observer    */
  263. enum {
  264.     cmStdobsUnknown                = 0x00000000,
  265.     cmStdobs1931TwoDegrees        = 0x00000001,
  266.     cmStdobs1964TenDegrees        = 0x00000002
  267. };
  268.  
  269. /* Standard Illuminant */
  270. enum {
  271.     cmIlluminantUnknown            = 0x00000000,
  272.     cmIlluminantD50                = 0x00000001,
  273.     cmIlluminantD65                = 0x00000002,
  274.     cmIlluminantD93                = 0x00000003,
  275.     cmIlluminantF2                = 0x00000004,
  276.     cmIlluminantD55                = 0x00000005,
  277.     cmIlluminantA                = 0x00000006,
  278.     cmIlluminantEquiPower        = 0x00000007,
  279.     cmIlluminantF8                = 0x00000008
  280. };
  281.  
  282. /* Spot Function Value */
  283. enum {
  284.     cmSpotFunctionUnknown        = 0,
  285.     cmSpotFunctionDefault        = 1,
  286.     cmSpotFunctionRound            = 2,
  287.     cmSpotFunctionDiamond        = 3,
  288.     cmSpotFunctionEllipse        = 4,
  289.     cmSpotFunctionLine            = 5,
  290.     cmSpotFunctionSquare        = 6,
  291.     cmSpotFunctionCross            = 7
  292. };
  293.  
  294. /* Color Space Signatures */
  295. enum {
  296.     cmXYZData                    = FOUR_CHAR_CODE('XYZ '),
  297.     cmLabData                    = FOUR_CHAR_CODE('Lab '),
  298.     cmLuvData                    = FOUR_CHAR_CODE('Luv '),
  299.     cmYxyData                    = FOUR_CHAR_CODE('Yxy '),
  300.     cmRGBData                    = FOUR_CHAR_CODE('RGB '),
  301.     cmGrayData                    = FOUR_CHAR_CODE('GRAY'),
  302.     cmHSVData                    = FOUR_CHAR_CODE('HSV '),
  303.     cmHLSData                    = FOUR_CHAR_CODE('HLS '),
  304.     cmCMYKData                    = FOUR_CHAR_CODE('CMYK'),
  305.     cmCMYData                    = FOUR_CHAR_CODE('CMY '),
  306.     cmMCH5Data                    = FOUR_CHAR_CODE('MCH5'),
  307.     cmMCH6Data                    = FOUR_CHAR_CODE('MCH6'),
  308.     cmMCH7Data                    = FOUR_CHAR_CODE('MCH7'),
  309.     cmMCH8Data                    = FOUR_CHAR_CODE('MCH8'),
  310.     cm3CLRData                    = FOUR_CHAR_CODE('3CLR'),
  311.     cm4CLRData                    = FOUR_CHAR_CODE('4CLR'),
  312.     cm5CLRData                    = FOUR_CHAR_CODE('5CLR'),
  313.     cm6CLRData                    = FOUR_CHAR_CODE('6CLR'),
  314.     cm7CLRData                    = FOUR_CHAR_CODE('7CLR'),
  315.     cm8CLRData                    = FOUR_CHAR_CODE('8CLR'),
  316.     cmNamedData                    = FOUR_CHAR_CODE('NAME')
  317. };
  318.  
  319. /* profileClass enumerations */
  320. enum {
  321.     cmInputClass                = FOUR_CHAR_CODE('scnr'),
  322.     cmDisplayClass                = FOUR_CHAR_CODE('mntr'),
  323.     cmOutputClass                = FOUR_CHAR_CODE('prtr'),
  324.     cmLinkClass                    = FOUR_CHAR_CODE('link'),
  325.     cmAbstractClass                = FOUR_CHAR_CODE('abst'),
  326.     cmColorSpaceClass            = FOUR_CHAR_CODE('spac'),
  327.     cmNamedColorClass            = FOUR_CHAR_CODE('nmcl')
  328. };
  329.  
  330. /* platform enumerations */
  331. enum {
  332.     cmMacintosh                    = FOUR_CHAR_CODE('APPL'),
  333.     cmMicrosoft                    = FOUR_CHAR_CODE('MSFT'),
  334.     cmSolaris                    = FOUR_CHAR_CODE('SUNW'),
  335.     cmSiliconGraphics            = FOUR_CHAR_CODE('SGI '),
  336.     cmTaligent                    = FOUR_CHAR_CODE('TGNT')
  337. };
  338.  
  339. /* ColorSync 1.0 elements */
  340. enum {
  341.     cmCS1ChromTag                = FOUR_CHAR_CODE('chrm'),
  342.     cmCS1TRCTag                    = FOUR_CHAR_CODE('trc '),
  343.     cmCS1NameTag                = FOUR_CHAR_CODE('name'),
  344.     cmCS1CustTag                = FOUR_CHAR_CODE('cust')
  345. };
  346.  
  347. /* General element data types */
  348.  
  349. struct CMDateTime {
  350.     unsigned short                     year;
  351.     unsigned short                     month;
  352.     unsigned short                     dayOfTheMonth;
  353.     unsigned short                     hours;
  354.     unsigned short                     minutes;
  355.     unsigned short                     seconds;
  356. };
  357. typedef struct CMDateTime                CMDateTime;
  358.  
  359. struct CMFixedXYZColor {
  360.     Fixed                             X;
  361.     Fixed                             Y;
  362.     Fixed                             Z;
  363. };
  364. typedef struct CMFixedXYZColor            CMFixedXYZColor;
  365.  
  366. typedef unsigned short                     CMXYZComponent;
  367.  
  368. struct CMXYZColor {
  369.     CMXYZComponent                     X;
  370.     CMXYZComponent                     Y;
  371.     CMXYZComponent                     Z;
  372. };
  373. typedef struct CMXYZColor                CMXYZColor;
  374.  
  375. struct CM2Header {
  376.     unsigned long                     size;                        /* This is the total size of the Profile */
  377.     OSType                             CMMType;                    /* CMM signature,  Registered with CS2 consortium  */
  378.     unsigned long                     profileVersion;                /* Version of CMProfile format */
  379.     OSType                             profileClass;                /* input, display, output, devicelink, abstract, or color conversion profile type */
  380.     OSType                             dataColorSpace;                /* color space of data */
  381.     OSType                             profileConnectionSpace;        /* profile connection color space */
  382.     CMDateTime                         dateTime;                    /* date and time of profile creation */
  383.     OSType                             CS2profileSignature;        /* 'acsp' constant ColorSync 2.0 file ID */
  384.     OSType                             platform;                    /* primary profile platform, Registered with CS2 consortium */
  385.     unsigned long                     flags;                        /* profile flags */
  386.     OSType                             deviceManufacturer;            /* Registered with ICC consortium */
  387.     unsigned long                     deviceModel;                /* Registered with ICC consortium */
  388.     unsigned long                     deviceAttributes[2];        /* Attributes[0] is for device vendors, [1] is for ICC */
  389.     unsigned long                     renderingIntent;            /* preferred rendering intent of tagged object */
  390.     CMFixedXYZColor                 white;                        /* profile illuminant */
  391.     OSType                             creator;                    /* profile creator */
  392.     char                             reserved[44];                /* reserved for future use */
  393. };
  394. typedef struct CM2Header                CM2Header;
  395.  
  396. struct CMTagRecord {
  397.     OSType                             tag;                        /* Registered with CS2 consortium */
  398.     unsigned long                     elementOffset;                /* Relative to start of CMProfile */
  399.     unsigned long                     elementSize;
  400. };
  401. typedef struct CMTagRecord                CMTagRecord;
  402.  
  403. struct CMTagElemTable {
  404.     unsigned long                     count;
  405.     CMTagRecord                     tagList[1];                    /* Variable size */
  406. };
  407. typedef struct CMTagElemTable            CMTagElemTable;
  408. /* External 0x02002001 CMProfile */
  409.  
  410. struct CM2Profile {
  411.     CM2Header                         header;
  412.     CMTagElemTable                     tagTable;
  413.     char                             elemData[1];                /* Tagged element storage. Variable size */
  414. };
  415. typedef struct CM2Profile                CM2Profile;
  416. typedef CM2Profile *                    CM2ProfilePtr;
  417. typedef CM2ProfilePtr *                    CM2ProfileHandle;
  418. /* Tag Type Definitions */
  419.  
  420. struct CMCurveType {
  421.     OSType                             typeDescriptor;                /* 'curv' */
  422.     unsigned long                     reserved;                    /* fill with 0x00 */
  423.     unsigned long                     countValue;                    /* number of entries in table that follows */
  424.     unsigned short                     data[1];                    /* Tagged element storage. Variable size */
  425. };
  426. typedef struct CMCurveType                CMCurveType;
  427.  
  428. struct CMDataType {
  429.     OSType                             typeDescriptor;                /* 'data' */
  430.     unsigned long                     reserved;                    /* fill with 0x00 */
  431.     unsigned long                     dataFlag;                    /* 0 = ASCII, 1 = binary */
  432.     char                             data[1];                    /* Tagged element storage. Variable size */
  433. };
  434. typedef struct CMDataType                CMDataType;
  435.  
  436. struct CMDateTimeType {
  437.     OSType                             typeDescriptor;                /* 'dtim' */
  438.     unsigned long                     reserved;
  439.     CMDateTime                         dateTime;
  440. };
  441. typedef struct CMDateTimeType            CMDateTimeType;
  442.  
  443. struct CMLut16Type {
  444.     OSType                             typeDescriptor;                /* 'mft2' */
  445.     unsigned long                     reserved;                    /* fill with 0x00 */
  446.     unsigned char                     inputChannels;                /* Number of input channels */
  447.     unsigned char                     outputChannels;                /* Number of output channels */
  448.     unsigned char                     gridPoints;                    /* Number of clutTable grid points */
  449.     unsigned char                     reserved2;                    /* fill with 0x00 */
  450.     Fixed                             matrix[3][3];                /* */
  451.     unsigned short                     inputTableEntries;            /* */
  452.     unsigned short                     outputTableEntries;            /* */
  453.     unsigned short                     inputTable[1];                /* Variable size */
  454.     unsigned short                     CLUT[1];                    /* Variable size */
  455.     unsigned short                     outputTable[1];                /* Variable size */
  456. };
  457. typedef struct CMLut16Type                CMLut16Type;
  458.  
  459. struct CMLut8Type {
  460.     OSType                             typeDescriptor;                /* 'mft1' */
  461.     unsigned long                     reserved;                    /* fill with 0x00 */
  462.     unsigned char                     inputChannels;                /* */
  463.     unsigned char                     outputChannels;                /* */
  464.     unsigned char                     gridPoints;                    /* */
  465.     unsigned char                     reserved2;                    /* fill with 0x00 */
  466.     Fixed                             matrix[3][3];                /* */
  467.     unsigned char                     inputTable[256];            /* fixed size of 256 */
  468.     unsigned char                     CLUT[2];                    /* Variable size */
  469.     unsigned char                     outputTable[256];            /* fixed size of 256 */
  470. };
  471. typedef struct CMLut8Type                CMLut8Type;
  472.  
  473. struct CMMeasurementType {
  474.     OSType                             typeDescriptor;                /* 'meas' */
  475.     unsigned long                     reserved;                    /* fill with 0x00 */
  476.     unsigned long                     standardObserver;            /* 0 : unknown, 1 : CIE 1931, 2 : CIE 1964 */
  477.     CMFixedXYZColor                 backingXYZ;                    /* absolute XYZ values of backing */
  478.     unsigned long                     geometry;                    /* 0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0 */
  479.     unsigned long                     flare;                        /* 0 : 0%, 1 : 100% flare */
  480.     unsigned long                     illuminant;                    /* standard illuminant */
  481. };
  482. typedef struct CMMeasurementType        CMMeasurementType;
  483.  
  484. struct CMNamedColorType {
  485.     OSType                             typeDescriptor;                /* 'ncol' */
  486.     unsigned long                     reserved;                    /* fill with 0x00 */
  487.     unsigned long                     vendorFlag;                    /* */
  488.     unsigned long                     count;                        /* count of named colors in array that follows */
  489.     unsigned char                     prefixName[1];                /* Variable size, max = 32, to access fields after this one, have to count bytes */
  490.     unsigned char                     suffixName[1];                /* Variable size, max = 32 */
  491.     char                             data[1];                    /* varaible size data as explained below */
  492. };
  493. typedef struct CMNamedColorType            CMNamedColorType;
  494. /*    
  495.     A variable size array of structs appears as the last block of data
  496.     in the above struct, CMNamedColorType.  The data structure
  497.     is as follows: (example in C)
  498.     
  499.     struct {                                             
  500.         unsigned char    rootName[1];                 * Variable size, max = 32 
  501.         unsigned char    colorCoords[1];                 * Variable size  
  502.     } colorName[1];                                     * Variable size  
  503. */
  504.  
  505. struct CMNamedColor2Type {
  506.     OSType                             typeDescriptor;                /* 'ncl2' */
  507.     unsigned long                     reserved;                    /* fill with 0x00 */
  508.     unsigned long                     vendorFlag;                    /* lower 16 bits reserved for ICC use */
  509.     unsigned long                     count;                        /* count of named colors in array that follows */
  510.     unsigned long                     deviceChannelCount;            /* number of device channels, 0 indicates no device value available */
  511.     unsigned char                     prefixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  512.     unsigned char                     suffixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  513.     char                             data[1];                    /* varaible size data as definced below */
  514. };
  515. typedef struct CMNamedColor2Type        CMNamedColor2Type;
  516.  
  517. struct CMNamedColor2EntryType {
  518.     unsigned char                     rootName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  519.     unsigned short                     PCSColorCoords[3];            /* Lab or XYZ color */
  520.     unsigned short                     DeviceColorCoords[1];        /* Variable size */
  521. };
  522. typedef struct CMNamedColor2EntryType    CMNamedColor2EntryType;
  523.  
  524. struct CMTextDescriptionType {
  525.     OSType                             typeDescriptor;                /* 'desc' */
  526.     unsigned long                     reserved;                    /* fill with 0x00 */
  527.     unsigned long                     ASCIICount;                    /* the count of "bytes" */
  528.     unsigned char                     ASCIIName[2];                /* Variable size, to access fields after this one, have to count bytes */
  529.     unsigned long                     UniCodeCode;
  530.     unsigned long                     UniCodeCount;                /* the count of characters, each character has two bytes */
  531.     unsigned char                     UniCodeName[2];                /* Variable size */
  532.     short                             ScriptCodeCode;
  533.     unsigned char                     ScriptCodeCount;            /* the count of "bytes" */
  534.     unsigned char                     ScriptCodeName[2];            /* Variable size */
  535. };
  536. typedef struct CMTextDescriptionType    CMTextDescriptionType;
  537.  
  538. struct CMTextType {
  539.     OSType                             typeDescriptor;                /* 'text' */
  540.     unsigned long                     reserved;                    /* fill with 0x00 */
  541.     unsigned char                     text[1];                    /* count of text is obtained from tag size element */
  542. };
  543. typedef struct CMTextType                CMTextType;
  544.  
  545. struct CMUnicodeTextType {
  546.     OSType                             typeDescriptor;                /* 'utxt' */
  547.     unsigned long                     reserved;                    /* fill with 0x00 */
  548.     unsigned short                     text[1];                    /* count of text is obtained from tag size element */
  549. };
  550. typedef struct CMUnicodeTextType        CMUnicodeTextType;
  551.  
  552. struct CMScreeningType {
  553.     OSType                             typeDescriptor;                /* 'scrn' */
  554.     unsigned long                     reserved;                    /* fill with 0x00 */
  555.     unsigned long                     screeningFlag;                /* bit 0 : use printer default screens, bit 1 : inch/cm */
  556.     unsigned long                     channelCount;
  557.     char                             data[1];                    /* varaible size data as explained below */
  558. };
  559. typedef struct CMScreeningType            CMScreeningType;
  560. /*
  561.     A variable size array of structs appears as the last block of data
  562.     in the above struct, CMScreeningType.  The data structure
  563.     is as follows: (example in C)
  564.     
  565.     struct {
  566.         Fixed            frequency;
  567.         Fixed            angle;
  568.         unsigned long    sportFunction;
  569.      }    channelScreening[1];                        * Variable size 
  570. */
  571.  
  572. struct CMSignatureType {
  573.     OSType                             typeDescriptor;                /* 'sig ' */
  574.     unsigned long                     reserved;                    /* fill with 0x00 */
  575.     OSType                             signature;
  576. };
  577. typedef struct CMSignatureType            CMSignatureType;
  578.  
  579. struct CMS15Fixed16ArrayType {
  580.     OSType                             typeDescriptor;                /* 'sf32' */
  581.     unsigned long                     reserved;                    /* fill with 0x00 */
  582.     Fixed                             value[1];                    /* Variable size */
  583. };
  584. typedef struct CMS15Fixed16ArrayType    CMS15Fixed16ArrayType;
  585.  
  586. struct CMU16Fixed16ArrayType {
  587.     OSType                             typeDescriptor;                /* 'uf32' */
  588.     unsigned long                     reserved;                    /* fill with 0x00 */
  589.     unsigned long                     value[1];                    /* Variable size */
  590. };
  591. typedef struct CMU16Fixed16ArrayType    CMU16Fixed16ArrayType;
  592.  
  593. struct CMUInt16ArrayType {
  594.     OSType                             typeDescriptor;                /* 'ui16' */
  595.     unsigned long                     reserved;                    /* fill with 0x00 */
  596.     unsigned short                     value[1];                    /* Variable size */
  597. };
  598. typedef struct CMUInt16ArrayType        CMUInt16ArrayType;
  599.  
  600. struct CMUInt32ArrayType {
  601.     OSType                             typeDescriptor;                /* 'ui32' */
  602.     unsigned long                     reserved;                    /* fill with 0x00 */
  603.     unsigned long                     value[1];                    /* Variable size */
  604. };
  605. typedef struct CMUInt32ArrayType        CMUInt32ArrayType;
  606.  
  607. struct CMUInt64ArrayType {
  608.     OSType                             typeDescriptor;                /* 'ui64' */
  609.     unsigned long                     reserved;                    /* fill with 0x00 */
  610.     unsigned long                     value[1];                    /* Variable size (x2) */
  611. };
  612. typedef struct CMUInt64ArrayType        CMUInt64ArrayType;
  613.  
  614. struct CMUInt8ArrayType {
  615.     OSType                             typeDescriptor;                /* 'ui08' */
  616.     unsigned long                     reserved;                    /* fill with 0x00 */
  617.     unsigned char                     value[1];                    /* Variable size */
  618. };
  619. typedef struct CMUInt8ArrayType            CMUInt8ArrayType;
  620.  
  621. struct CMViewingConditionsType {
  622.     OSType                             typeDescriptor;                /* 'view' */
  623.     unsigned long                     reserved;                    /* fill with 0x00 */
  624.     CMFixedXYZColor                 illuminant;                    /* absolute XYZs of illuminant  in cd/m^2 */
  625.     CMFixedXYZColor                 surround;                    /* absolute XYZs of surround in cd/m^2 */
  626.     unsigned long                     stdIlluminant;                /* see definitions of std illuminants */
  627. };
  628. typedef struct CMViewingConditionsType    CMViewingConditionsType;
  629.  
  630. struct CMXYZType {
  631.     OSType                             typeDescriptor;                /* 'XYZ ' */
  632.     unsigned long                     reserved;                    /* fill with 0x00 */
  633.     CMFixedXYZColor                 XYZ[1];                        /* variable size XYZ tristimulus values */
  634. };
  635. typedef struct CMXYZType                CMXYZType;
  636. /* Profile sequence description type */
  637.  
  638. struct CMProfileSequenceDescType {
  639.     OSType                             typeDescriptor;                /* 'pseq ' */
  640.     unsigned long                     reserved;                    /* fill with 0x00 */
  641.     unsigned long                     count;                        /* Number of descriptions */
  642.     char                             data[1];                    /* varaible size data as explained below */
  643. };
  644. typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
  645. /*
  646.     A variable size array of structs appears as the last block of data
  647.     in the above struct, CMProfileSequenceDescType.  The data structure
  648.     is as follows: (example in C)
  649.     
  650.     struct {                                             
  651.         OSType            deviceMfg;                     * Device Manufacturer 
  652.         OSType            deviceModel;                 * Decvice Model 
  653.         unsigned long    attributes[2];                 * Device attributes 
  654.         OSType            technology;                     * Technology signature 
  655.         unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  656.         unsigned char    mfgDescASCIIName[2];         * Variable size 
  657.         unsigned long    mfgDescUniCodeCode;             
  658.         unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  659.         unsigned char    mfgDescUniCodeName[2];         * Variable size 
  660.         unsigned long    mfgDescScriptCodeCode;         
  661.         unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  662.         unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  663.         unsigned long    modelDescASCIICount;         * the count of "bytes" 
  664.         unsigned char    modelDescASCIIName[2];         * Variable size 
  665.         unsigned long    modelDescUniCodeCode;         
  666.         unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  667.         unsigned char    modelDescUniCodeName[2];     * Variable size 
  668.         short            modelDescScriptCodeCode;     
  669.         unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  670.         SInt8            filler;                         * For proper alignment across languages 
  671.         unsigned char    modelDescScriptCodeName[2];     * Variable size 
  672.     }    profileDescription[1];                         
  673. */
  674.  
  675. /* Under color removal, black generation type */
  676.  
  677. struct CMUcrBgType {
  678.     OSType                             typeDescriptor;                /* 'bfd  ' */
  679.     unsigned long                     reserved;                    /* fill with 0x00 */
  680.     unsigned long                     ucrCount;                    /* Number of UCR entries */
  681.     unsigned short                     ucrValues[1];                /* variable size */
  682.     unsigned long                     bgCount;                    /* Number of BG entries */
  683.     unsigned short                     bgValues[1];                /* variable size */
  684.     unsigned char                     ucrbgASCII[1];                /* null terminated ASCII string */
  685. };
  686. typedef struct CMUcrBgType                CMUcrBgType;
  687.  
  688. struct CMIntentCRDVMSize {
  689.     long                             renderingIntent;            /* rendering intent */
  690.     unsigned long                     VMSize;                        /* VM size taken up by the CRD */
  691. };
  692. typedef struct CMIntentCRDVMSize        CMIntentCRDVMSize;
  693.  
  694. struct CMPS2CRDVMSizeType {
  695.     OSType                             typeDescriptor;                /* 'psvm' */
  696.     unsigned long                     reserved;                    /* fill with 0x00 */
  697.     unsigned long                     count;                        /* number of intent entries */
  698.     CMIntentCRDVMSize                 intentCRD[1];                /* variable size */
  699. };
  700. typedef struct CMPS2CRDVMSizeType        CMPS2CRDVMSizeType;
  701. /* Video Card Gamma type */
  702. enum {
  703.     cmVideoCardGammaTableType    = 0,
  704.     cmVideoCardGammaFormulaType    = 1
  705. };
  706.  
  707.  
  708.  
  709. struct CMVideoCardGammaTable {
  710.     unsigned short                     channels;                    /* # of gamma channels (1 or 3) */
  711.     unsigned short                     entryCount;                    /* 1-based number of entries per channel */
  712.     unsigned short                     entrySize;                    /* size on bytes of each entry */
  713.     char                             data[1];                    /* variable size data follows */
  714. };
  715. typedef struct CMVideoCardGammaTable    CMVideoCardGammaTable;
  716.  
  717. struct CMVideoCardGammaFormula {
  718.     Fixed                             redGamma;                    /* must be > 0.0 */
  719.     Fixed                             redMin;                        /* must be > 0.0 and < 1.0 */
  720.     Fixed                             redMax;                        /* must be > 0.0 and < 1.0 */
  721.     Fixed                             greenGamma;                    /* must be > 0.0 */
  722.     Fixed                             greenMin;                    /* must be > 0.0 and < 1.0 */
  723.     Fixed                             greenMax;                    /* must be > 0.0 and < 1.0 */
  724.     Fixed                             blueGamma;                    /* must be > 0.0 */
  725.     Fixed                             blueMin;                    /* must be > 0.0 and < 1.0 */
  726.     Fixed                             blueMax;                    /* must be > 0.0 and < 1.0 */
  727. };
  728. typedef struct CMVideoCardGammaFormula    CMVideoCardGammaFormula;
  729.  
  730. struct CMVideoCardGamma {
  731.     unsigned long                     tagType;
  732.     union {
  733.         CMVideoCardGammaTable             table;
  734.         CMVideoCardGammaFormula         formula;
  735.     }                                 u;
  736. };
  737. typedef struct CMVideoCardGamma            CMVideoCardGamma;
  738.  
  739. struct CMVideoCardGammaType {
  740.     OSType                             typeDescriptor;                /* 'vcgt' */
  741.     unsigned long                     reserved;                    /* fill with 0x00 */
  742.     CMVideoCardGamma                 gamma;
  743. };
  744. typedef struct CMVideoCardGammaType        CMVideoCardGammaType;
  745.  
  746. struct CMMakeAndModel {
  747.     OSType                             manufacturer;
  748.     unsigned long                     model;
  749.     unsigned long                     serialNumber;
  750.     unsigned long                     manufactureDate;
  751.     unsigned long                     reserved1;                    /* fill with 0x00 */
  752.     unsigned long                     reserved2;                    /* fill with 0x00 */
  753.     unsigned long                     reserved3;                    /* fill with 0x00 */
  754.     unsigned long                     reserved4;                    /* fill with 0x00 */
  755. };
  756. typedef struct CMMakeAndModel            CMMakeAndModel;
  757.  
  758. struct CMMakeAndModelType {
  759.     OSType                             typeDescriptor;                /* 'mmod' */
  760.     unsigned long                     reserved;                    /* fill with 0x00 */
  761.     CMMakeAndModel                     makeAndModel;
  762. };
  763. typedef struct CMMakeAndModelType        CMMakeAndModelType;
  764. /************************************************************************/
  765. /*************** ColorSync 1.0 profile specification ********************/
  766. /************************************************************************/
  767. enum {
  768.     cmGrayResponse                = 0,
  769.     cmRedResponse                = 1,
  770.     cmGreenResponse                = 2,
  771.     cmBlueResponse                = 3,
  772.     cmCyanResponse                = 4,
  773.     cmMagentaResponse            = 5,
  774.     cmYellowResponse            = 6,
  775.     cmUcrResponse                = 7,
  776.     cmBgResponse                = 8,
  777.     cmOnePlusLastResponse        = 9
  778. };
  779.  
  780.  
  781. /* Device types */
  782. enum {
  783.     cmMonitorDevice                = FOUR_CHAR_CODE('mntr'),
  784.     cmScannerDevice                = FOUR_CHAR_CODE('scnr'),
  785.     cmPrinterDevice                = FOUR_CHAR_CODE('prtr')
  786. };
  787.  
  788.  
  789.  
  790. struct CMIString {
  791.     ScriptCode                         theScript;
  792.     Str63                             theString;
  793. };
  794. typedef struct CMIString                CMIString;
  795. /* Profile options */
  796. enum {
  797.     cmPerceptualMatch            = 0x0000,                        /* Default. For photographic images */
  798.     cmColorimetricMatch            = 0x0001,                        /* Exact matching when possible */
  799.     cmSaturationMatch            = 0x0002                        /* For solid colors */
  800. };
  801.  
  802. /* Profile flags */
  803. enum {
  804.     cmNativeMatchingPreferred    = 0x00000001,                    /* Default to native not preferred */
  805.     cmTurnOffCache                = 0x00000002                    /* Default to turn on CMM cache */
  806. };
  807.  
  808.  
  809. typedef long                             CMMatchOption;
  810. typedef long                             CMMatchFlag;
  811.  
  812. struct CMHeader {
  813.     unsigned long                     size;
  814.     OSType                             CMMType;
  815.     unsigned long                     applProfileVersion;
  816.     OSType                             dataType;
  817.     OSType                             deviceType;
  818.     OSType                             deviceManufacturer;
  819.     unsigned long                     deviceModel;
  820.     unsigned long                     deviceAttributes[2];
  821.     unsigned long                     profileNameOffset;
  822.     unsigned long                     customDataOffset;
  823.     CMMatchFlag                     flags;
  824.     CMMatchOption                     options;
  825.     CMXYZColor                         white;
  826.     CMXYZColor                         black;
  827. };
  828. typedef struct CMHeader                    CMHeader;
  829.  
  830. struct CMProfileChromaticities {
  831.     CMXYZColor                         red;
  832.     CMXYZColor                         green;
  833.     CMXYZColor                         blue;
  834.     CMXYZColor                         cyan;
  835.     CMXYZColor                         magenta;
  836.     CMXYZColor                         yellow;
  837. };
  838. typedef struct CMProfileChromaticities    CMProfileChromaticities;
  839.  
  840. struct CMProfileResponse {
  841.     unsigned short                     counts[9];
  842.     unsigned short                     data[1];                    /* Variable size */
  843. };
  844. typedef struct CMProfileResponse        CMProfileResponse;
  845.  
  846. struct CMProfile {
  847.     CMHeader                         header;
  848.     CMProfileChromaticities         profile;
  849.     CMProfileResponse                 response;
  850.     CMIString                         profileName;
  851.     char                             customData[1];                /* Variable size */
  852. };
  853. typedef struct CMProfile                CMProfile;
  854. typedef CMProfile *                        CMProfilePtr;
  855. typedef CMProfilePtr *                    CMProfileHandle;
  856. #if OLDROUTINENAMES
  857. enum {
  858.     kCMApplProfileVersion        = cmCS1ProfileVersion
  859. };
  860.  
  861. enum {
  862.     grayResponse                = cmGrayResponse,
  863.     redResponse                    = cmRedResponse,
  864.     greenResponse                = cmGreenResponse,
  865.     blueResponse                = cmBlueResponse,
  866.     cyanResponse                = cmCyanResponse,
  867.     magentaResponse                = cmMagentaResponse,
  868.     yellowResponse                = cmYellowResponse,
  869.     ucrResponse                    = cmUcrResponse,
  870.     bgResponse                    = cmBgResponse,
  871.     onePlusLastResponse            = cmOnePlusLastResponse
  872. };
  873.  
  874. enum {
  875.     rgbData                        = cmRGBData,
  876.     cmykData                    = cmCMYKData,
  877.     grayData                    = cmGrayData,
  878.     xyzData                        = cmXYZData
  879. };
  880.  
  881. enum {
  882.     XYZData                        = cmXYZData
  883. };
  884.  
  885. enum {
  886.     monitorDevice                = cmMonitorDevice,
  887.     scannerDevice                = cmScannerDevice,
  888.     printerDevice                = cmPrinterDevice
  889. };
  890.  
  891. enum {
  892.     CMNativeMatchingPreferred    = cmNativeMatchingPreferred,    /* Default to native not preferred */
  893.     CMTurnOffCache                = cmTurnOffCache                /* Default to turn on CMM cache */
  894. };
  895.  
  896. enum {
  897.     CMPerceptualMatch            = cmPerceptualMatch,            /* Default. For photographic images */
  898.     CMColorimetricMatch            = cmColorimetricMatch,            /* Exact matching when possible */
  899.     CMSaturationMatch            = cmSaturationMatch                /* For solid colors */
  900. };
  901.  
  902.  
  903. typedef unsigned short                     XYZComponent;
  904. typedef CMXYZColor                         XYZColor;
  905. typedef unsigned short                     CMResponseData;
  906. typedef CMIString                         IString;
  907. typedef long                             CMResponseColor;
  908. typedef CMResponseColor                 responseColor;
  909. #endif  /* OLDROUTINENAMES */
  910.  
  911.  
  912.  
  913. #if PRAGMA_STRUCT_ALIGN
  914.     #pragma options align=reset
  915. #elif PRAGMA_STRUCT_PACKPUSH
  916.     #pragma pack(pop)
  917. #elif PRAGMA_STRUCT_PACK
  918.     #pragma pack()
  919. #endif
  920.  
  921. #ifdef PRAGMA_IMPORT_OFF
  922. #pragma import off
  923. #elif PRAGMA_IMPORT
  924. #pragma import reset
  925. #endif
  926.  
  927. #ifdef __cplusplus
  928. }
  929. #endif
  930.  
  931. #endif /* __CMICCPROFILE__ */
  932.  
  933.